package com.zoffy.ybuhelper.util;

import java.io.File;

public class FileUtil {
    private static FileUtil fileUtil=null;

    public static FileUtil getInstance() {
        if(fileUtil==null)
            fileUtil=new FileUtil();
        return fileUtil;
    }
    public void deleteFile(File file){
        if(file.isFile())
            file.delete();
        else{
            File[] files=file.listFiles();
            if(files==null)
                return;
            for(File son_file:file.listFiles())
                if(son_file.isFile())
                    son_file.delete();
                else
                    deleteFile(son_file);
            }
        }
    }
